#!/usr/bin/env bash

if [ -z "$1" ]; then
    echo "Usage: $0 <path>"
    exit 1
fi

path="$1"

for file in $(find "$path" -type f \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \)); do
    clang-format -style=file -i "$file"
done
